<!DOCTYPE html>
<html>
<head>
  <%= render partial: 'layouts/head', locals: {title: (t 'web.org') + (t 'web.manage_system')} %>
</head>
<body>
<%= render partial: 'layouts/nav', locals: {title: (t 'web.org') + (t 'web.manage_system')} %>

<div class="main-container" id="main-container">
  <div class="main-container-inner">
    <a class="menu-toggler" id="menu-toggler" href="#">
      <span class="menu-text"></span>
    </a>

    <div class="sidebar" id="sidebar">
      <script type="text/javascript">
          try {
              ace.settings.check('sidebar', 'fixed')
          } catch (e) {
          }
      </script>
      <ul class="nav nav-list">

        <% if can? :manage, User %>
            <li data-model="user_list">
              <%= link_to admin_users_path do %>
                  <i class="icon-user"></i>
                  <span class="menu-text"> <%= t 'activerecord.attributes.user.admin_title' %> </span>
              <% end %>
            </li>
        <% end %>
        <% if can? :manage, Organization %>
            <li data-model="organization_list">
              <%= link_to admin_organizations_path do %>
                  <i class="icon-group"></i>
                  <span class="menu-text"> <%= t 'activerecord.attributes.organization.admin_title' %> </span>
              <% end %>
            </li>
        <% end %>
        <% if can? :manage, CodeTable %>
            <li data-model="code_table_list">
              <%= link_to admin_code_tables_path do %>
                  <i class="icon-book"></i>
                  <span class="menu-text"> <%= t 'activerecord.attributes.code_table.admin_title' %> </span>
              <% end %>
            </li>
        <% end %>
        <% if can? :manage, Role %>
            <li data-model="role_list">
              <%= link_to admin_roles_path do %>
                  <i class="icon-key"></i>
                  <span class="menu-text"> <%= t 'activerecord.attributes.role.admin_title' %> </span>
              <% end %>
            </li>
        <% end %>
        <% if can? :manage, Permission %>
            <li data-model="permission_list">
              <%= link_to admin_permissions_path do %>
                  <i class="icon-lock"></i>
                  <span class="menu-text"> <%= t 'activerecord.attributes.permission.admin_title' %> </span>
              <% end %>
            </li>
        <% end %>
        <% if can? :manage, Permission %>
            <li data-model="attachment_list">
              <%= link_to admin_attachments_path do %>
                  <i class="icon-cloud-upload"></i>
                  <span class="menu-text"> <%= t 'activerecord.attributes.attachment.admin_title' %> </span>
              <% end %>
            </li>
        <% end %>
        <li data-model="process_define_list">
          <%= link_to admin_process_defines_path do %>
              <i class="icon-cloud-upload"></i>
              <span class="menu-text"> ProcessDefine</span>
          <% end %>
        </li>
        <li data-model="process_instance_list">
          <%= link_to admin_process_instances_path do %>
              <i class="icon-cloud-upload"></i>
              <span class="menu-text"> ProcessInstance</span>
          <% end %>
        </li>
        <li data-model="process_active_instance_list">
          <%= link_to admin_process_active_instances_path do %>
              <i class="icon-cloud-upload"></i>
              <span class="menu-text"> ProcessAI </span>
          <% end %>
        </li>
        <li data-model="process_task_list">
          <%= link_to admin_process_tasks_path do %>
              <i class="icon-cloud-upload"></i>
              <span class="menu-text"> ProcessTask </span>
          <% end %>
        </li>

      </ul>
      <div class="sidebar-collapse" id="sidebar-collapse">
        <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
      </div>

      <script type="text/javascript">
          try {
              ace.settings.check('sidebar', 'collapsed')
          } catch (e) {
          }
      </script>
    </div>
    <div class="main-content" data-pjax-container>
      <%= render template: 'layouts/admin/pjax' %>
    </div>
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
      <i class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
  </div>
  <!-- /.main-container-inner -->
</div>
<script>
    $(function () {
        $(document).pjax('a.pjax:not([data-remote]):not([data-behavior]):not([data-skip-pjax])', '[data-pjax-container]');
    });
</script>
</body>
</html>
